home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-23 | 1.4 KB | 43 lines | [TEXT/MPS ] |
- The Essential Hack.
- Written for MacHack ’92 by Allan Foster and Scott Boyd.
-
- This hack simply counts traps and draws the counters (literally)
- into the menu bar.
-
- The hack demonstrates how to:
- • head-patch a trap
- • tail-patch a trap
- • add a filter to a filter proc
- • draw into the window manager port
- • use Gestalt to communicate between extension code and an app
- • unhook patch code
- • do all of this without trashing registers
-
- This code is meant to help you better understand some of the essential
- hacking techniques. We hope you find it instructional.
-
- We’ve included a second patching file which shows a much simpler
- way to patch, but it lagged behind Essential.a, and is missing about
- two days worth of work.
-
- While we tried hard to be clean, no code is perfect, especially
- code which changes right up to the time the code is presented to
- a couple hundred hungry hackers.
-
- If you find bugs or make improvements to the code, we’d appreciate
- hearing from you. If you’d like to give a similar talk at MacHack ’93,
- we’d really like to hear from you. Also, if there are more topics like
- this you’d like to see covered at MacHack, we’re eager to hear your
- suggestions.
-
- Feel free to contact us at AppleLink SCOTT and ALLAN.
-
- To build the extension:
-
- asm essential.a
- link essential.a.o showinit.a.o -o Essential -rt INIT=0 ∂
- -c Sntl -t INIT -sg Essential
-
- To try it out:
- duplicate Essential "{systemfolder}"extensions:
- shutdown -r